﻿@model IEnumerable<MobileSales.Model.Tasks.Schedule>
@using MobileSales.Website.Controllers

@{
    View.Title = Strings.Schedules;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@Strings.Schedules</h2>

<p>
    @using (Html.BeginForm("Index","Schedules",FormMethod.Get)) {
    
        @ModelStrings.Employee <text>:</text>
        @Html.EmployeeSelect("employeeId", (int?)ViewData["employeeId"])
        <input type="submit" value="@Strings.Go" />
    }

    <br />

    @if (Model != null && ((int?)ViewData["employeeId"]).HasValue)
    {
        int emplId = ((int?)ViewData["employeeId"]).Value;
         @Html.ActionLink(Strings.AddTask, "Create", "Tasks", new { employeeId = emplId }, new { @class = "icon-button add-icon" })
        
         @Html.ScheduleCalendar(emplId, Model, 
                                      ((DateTime)Session[SchedulesController.ScheduleDateSessionKey]).Year,
                                      ((DateTime)Session[SchedulesController.ScheduleDateSessionKey]).Month)

    }
</p>


